class Comment {
  int? id;
  String content;
  int userId;
  int roomId;

  Comment({
    this.id,
    required this.content,
    required this.userId,
    required this.roomId,
  });

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'content': content,
      'userId': userId,
      'roomId': roomId,
    };
  }

  factory Comment.fromMap(Map<String, dynamic> map) {
    return Comment(
      id: map['id'],
      content: map['content'],
      userId: map['userId'],
      roomId: map['roomId'],
    );
  }

  Comment copyWith({
    int? id,
    String? content,
    int? userId,
    int? roomId,
  }) {
    return Comment(
      id: id ?? this.id,
      content: content ?? this.content,
      userId: userId ?? this.userId,
      roomId: roomId ?? this.roomId,
    );
  }
}
